<html lang="en"><head></head><body><form id="mainForm" method="post" action="http://plnkr.co/edit/?p=preview" target="_self"><input type="hidden" name="files[app/app.component.ts]" value="import { Component } from '@angular/core';

@Component({
  moduleId: module.id,
  selector: 'my-app',
  template: '<my-vehicle-list></my-vehicle-list>'
})
export class AppComponent {}



/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="files[app/app.module.ts]" value="import { NgModule } from '@angular/core';
import { BrowserModule  } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';

import { AppComponent } from './app.component';
import { VehicleListComponent } from './vehicle-list.component';
import { VehicleService } from './vehicle.service';

@NgModule({
  imports: [BrowserModule, HttpModule],
  declarations: [
    AppComponent,
    VehicleListComponent
  ],
  providers: [VehicleService],
  bootstrap: [AppComponent]
})
export class AppModule { }


/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="files[app/vehicle-list.component.ts]" value="import { Component } from '@angular/core';
import { Vehicle, VehicleService } from './vehicle.service';

@Component({
  moduleId: module.id,
  selector: 'my-vehicle-list',
  templateUrl: 'vehicle-list.component.html',
  styles: ['li {cursor: pointer;} .error {color:red;}']
})
export class VehicleListComponent {
  errorMessage: string;
  vehicles: Vehicle[];

  constructor(private _vehicleService: VehicleService) { }

  getVehicles() {
    this._vehicleService.getVehicles()
      .subscribe(
        vehicles => this.vehicles = vehicles,
        error =>  this.errorMessage = <any>error
    );
  }

  ngOnInit() { this.getVehicles(); }
}



/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="files[app/vehicle.service.ts]" value="import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';

export class Vehicle {
  constructor(public id: number, public name: string, public side: string) { }
}

@Injectable()
export class VehicleService {
  constructor(private http: Http) { }

  getVehicles() {
    return this.http
      .get('api/vehicles.json')
      .map((response: Response) =>
        <Vehicle[]>response.json().data
      )
      .catch(this.handleError);
  }

  private handleError(error: Response) {
    console.error(error);
    return Observable.throw(error.json().error || 'Server error');
  }
}


/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="files[main.ts]" value="import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';

platformBrowserDynamic().bootstrapModule(AppModule)
  .then(success => console.log(`Bootstrap success`))
  .catch(err => console.error(err));


/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="files[styles.css]" value="/* Master Styles */
h1 {
  color: #369;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 250%;
}
h2, h3 {
  color: #444;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: lighter;
}
body {
  margin: 2em;
}
body, input[text], button {
  color: #888;
  font-family: Cambria, Georgia;
}
a {
  cursor: pointer;
  cursor: hand;
}
button {
  font-family: Arial;
  background-color: #eee;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  cursor: hand;
}
button:hover {
  background-color: #cfd8dc;
}
button:disabled {
  background-color: #eee;
  color: #aaa;
  cursor: auto;
}

/* Navigation link styles */
nav a {
  padding: 5px 10px;
  text-decoration: none;
  margin-top: 10px;
  display: inline-block;
  background-color: #eee;
  border-radius: 4px;
}
nav a:visited, a:link {
  color: #607D8B;
}
nav a:hover {
  color: #039be5;
  background-color: #CFD8DC;
}
nav a.active {
  color: #039be5;
}

/* items class */
.items {
  margin: 0 0 2em 0;
  list-style-type: none;
  padding: 0;
  width: 24em;
}
.items li {
  cursor: pointer;
  position: relative;
  left: 0;
  background-color: #EEE;
  margin: .5em;
  padding: .3em 0;
  height: 1.6em;
  border-radius: 4px;
}
.items li:hover {
  color: #607D8B;
  background-color: #DDD;
  left: .1em;
}
.items li.selected:hover {
  background-color: #BBD8DC;
  color: white;
}
.items .text {
  position: relative;
  top: -3px;
}
.items {
  margin: 0 0 2em 0;
  list-style-type: none;
  padding: 0;
  width: 24em;
}
.items li {
  cursor: pointer;
  position: relative;
  left: 0;
  background-color: #EEE;
  margin: .5em;
  padding: .3em 0;
  height: 1.6em;
  border-radius: 4px;
}
.items li:hover {
  color: #607D8B;
  background-color: #DDD;
  left: .1em;
}
.items li.selected {
  background-color: #CFD8DC;
  color: white;
}

.items li.selected:hover {
  background-color: #BBD8DC;
}
.items .text {
  position: relative;
  top: -3px;
}
.items .badge {
  display: inline-block;
  font-size: small;
  color: white;
  padding: 0.8em 0.7em 0 0.7em;
  background-color: #607D8B;
  line-height: 1em;
  position: relative;
  left: -1px;
  top: -4px;
  height: 1.8em;
  margin-right: .8em;
  border-radius: 4px 0 0 4px;
}
/* everywhere else */
* {
  font-family: Arial, Helvetica, sans-serif;
}


/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="files[app/vehicle-list.component.html]" value="<ul>
  <li *ngFor=&quot;let vehicle of vehicles&quot;>
    {{ vehicle.name }}
  </li>
</ul>

<ul class=&quot;messages&quot;>
  <li *ngFor=&quot;let msg of messages&quot;>{{msg}}</li>
</ul>

<div class=&quot;error&quot; *ngIf=&quot;errorMessage&quot;>{{errorMessage}}</div>


<!-- 
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
-->"><input type="hidden" name="files[index.html]" value="<!DOCTYPE html>
<html>

<head>
  <script>document.write('<base href=&quot;' + document.location + '&quot; />');</script>

  <meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;>
</head>

<body>
  <my-app>Loading ...</my-app>

  <script src=&quot;https://npmcdn.com/core-js/client/shim.min.js&quot;></script>
  <script src=&quot;https://npmcdn.com/zone.js@0.6.26?main=browser&quot;></script>
  <script src=&quot;https://npmcdn.com/reflect-metadata@0.1.8&quot;></script>
  <script src=&quot;https://npmcdn.com/systemjs@0.19.40/dist/system.src.js&quot;></script>

  <script>
    System.import('systemjs.config.js')
      .then(function () { System.import('main') })
      .catch(console.error.bind(console));
  </script>
</body>

</html>


<!-- 
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
-->"><input type="hidden" name="files[api/characters.json]" value="{
  &quot;data&quot;: [
    {
      &quot;id&quot;: 11,
      &quot;name&quot;: &quot;Chewbacca&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 12,
      &quot;name&quot;: &quot;Rey&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 13,
      &quot;name&quot;: &quot;Finn (FN2187)&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 14,
      &quot;name&quot;: &quot;Han Solo&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 15,
      &quot;name&quot;: &quot;Leia Organa&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 16,
      &quot;name&quot;: &quot;Luke Skywalker&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 17,
      &quot;name&quot;: &quot;Poe Dameron&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 18,
      &quot;name&quot;: &quot;Kylo Ren&quot;,
      &quot;side&quot;: &quot;dark&quot;
    },
    {
      &quot;id&quot;: 19,
      &quot;name&quot;: &quot;Supreme Commander Snoke&quot;,
      &quot;side&quot;: &quot;dark&quot;
    },
    {
      &quot;id&quot;: 20,
      &quot;name&quot;: &quot;R2-D2&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 21,
      &quot;name&quot;: &quot;BB8&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 22,
      &quot;name&quot;: &quot;C-3PO&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 23,
      &quot;name&quot;: &quot;Maz Kanata&quot;,
      &quot;side&quot;: &quot;light&quot;
    },
    {
      &quot;id&quot;: 24,
      &quot;name&quot;: &quot;Captain Phasma&quot;,
      &quot;side&quot;: &quot;dark&quot;
    },
    {
      &quot;id&quot;: 25,
      &quot;name&quot;: &quot;General Hux&quot;,
      &quot;side&quot;: &quot;dark&quot;
    },
    {
      &quot;id&quot;: 26,
      &quot;name&quot;: &quot;Lor San Tekka&quot;,
      &quot;side&quot;: &quot;light&quot;
    }
  ]
}"><input type="hidden" name="files[api/vehicles.json]" value="{
  &quot;data&quot;: [
    {
      &quot;id&quot;: 30,
      &quot;name&quot;: &quot;Millennium Falcon&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 32,
      &quot;name&quot;: &quot;X-Wing Fighter&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 33,
      &quot;name&quot;: &quot;Imperial Star Destroyer&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 34,
      &quot;name&quot;: &quot;AT-AT Walker&quot;,
      &quot;type&quot;: &quot;land&quot;
    },
    {
      &quot;id&quot;: 35,
      &quot;name&quot;: &quot;TIE Fighter&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 36,
      &quot;name&quot;: &quot;B-Wing Fighter&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 37,
      &quot;name&quot;: &quot;ETA-2 Jedi Starfighter&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 38,
      &quot;name&quot;: &quot;TIE Interceptor&quot;,
      &quot;type&quot;: &quot;space&quot;
    },
    {
      &quot;id&quot;: 39,
      &quot;name&quot;: &quot;X-34 Landspeeder&quot;,
      &quot;type&quot;: &quot;land&quot;
    },
    {
      &quot;id&quot;: 40,
      &quot;name&quot;: &quot;Snow Speeder&quot;,
      &quot;type&quot;: &quot;land&quot;
    },
    {
      &quot;id&quot;: 41,
      &quot;name&quot;: &quot;X-34 Landspeeder&quot;,
      &quot;type&quot;: &quot;land&quot;
    }
  ]
}"><input type="hidden" name="tags[0]" value="angular2"><input type="hidden" name="tags[1]" value="example"><input type="hidden" name="tags[2]" value="first look"><input type="hidden" name="tags[3]" value="angular 2"><input type="hidden" name="private" value="true"><input type="hidden" name="description" value="Angular 2 Example - Angular 2 - Http"><input type="hidden" name="files[README.md]" value="### Angular 2 First Look Example 

Angular 2 - Http"><input type="hidden" name="files[systemjs.config.js]" value="/**
 * PLUNKER VERSION
 * (based on systemjs.config.js in angular.io)
 * System configuration for Angular 2 samples
 * Adjust as necessary for your application needs.
 */
(function (global) {
  System.config({
    // DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER
    transpiler: 'ts',
    typescriptOptions: {
      tsconfig: true
    },
    meta: {
      'typescript': {
        &quot;exports&quot;: &quot;ts&quot;
      }
    },
    paths: {
      // paths serve as alias
      'npm:': 'https://unpkg.com/'
    },
    // map tells the System loader where to look for things
    map: {
      // our app is within the app folder
      app: 'app',
      'main':                       'main.js', // PAPA

      // angular bundles
      '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
      '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
      '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
      '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
      '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
      '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
      '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
      '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
      '@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js',

      // other libraries
      'rxjs':                       'npm:rxjs',
      'angular-in-memory-web-api':  'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
      'ts':                         'npm:plugin-typescript@4.0.10/lib/plugin.js',
      'typescript':                 'npm:typescript@2.0.3/lib/typescript.js',

    },
    // packages tells the System loader how to load when no filename and/or no extension
    packages: {
      'app/core': { main: 'index' }, // PAPA
      'app/models': { main: 'index' }, // PAPA
      'api': { defaultExtension: 'js' }, //PAPA
      app: {
        main: './main.ts',
        defaultExtension: 'ts'
      },
      rxjs: {
        defaultExtension: 'js'
      }
    }
  });
})(this);



/*
Copyright 2016 JohnPapa.net, LLC. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://bit.ly/l1cense
*/"><input type="hidden" name="files[tsconfig.json]" value="{
  &quot;compilerOptions&quot;: {
    &quot;target&quot;: &quot;es5&quot;,
    &quot;module&quot;: &quot;commonjs&quot;,
    &quot;moduleResolution&quot;: &quot;node&quot;,
    &quot;sourceMap&quot;: true,
    &quot;emitDecoratorMetadata&quot;: true,
    &quot;experimentalDecorators&quot;: true,
    &quot;removeComments&quot;: false,
    &quot;noImplicitAny&quot;: false,
    &quot;suppressImplicitAnyIndexErrors&quot;: true
  }
}
"></form><script>document.getElementById("mainForm").submit();</script></body></html>